import 'package:flutter_test/flutter_test.dart';
import 'package:plugin_image/plugin_image.dart';
import 'package:plugin_image/plugin_image_platform_interface.dart';
import 'package:plugin_image/plugin_image_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPluginImagePlatform
    with MockPlatformInterfaceMixin
    implements PluginImagePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final PluginImagePlatform initialPlatform = PluginImagePlatform.instance;

  test('$MethodChannelPluginImage is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPluginImage>());
  });

  test('getPlatformVersion', () async {
    PluginImage pluginImagePlugin = PluginImage();
    MockPluginImagePlatform fakePlatform = MockPluginImagePlatform();
    PluginImagePlatform.instance = fakePlatform;

    expect(await pluginImagePlugin.getPlatformVersion(), '42');
  });
}
